package com.kcwx.common.utils;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

public class BooleanJsonSerializer extends JsonSerializer<Integer> {
	@Override
	public void serialize(Integer param, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
			throws IOException {
		boolean res = false;
		if (param != null) {
			res = param == 1 ? true : false;
		}
		jsonGenerator.writeBoolean(res);
	}

}
